package com.leyou.item.controller;

import com.leyou.item.pojo.Item;
import com.leyou.item.service.ItemService;
import com.netflix.discovery.converters.Auto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Eric
 * @version v1.0
 * @package com.leyou.item.controller
 * @date 2019/6/22 15:48
 * @description:
 **/
@RestController
public class ItemController {


    @Autowired
    private ItemService itemService;

    @PostMapping("item")
    public ResponseEntity<Item> saveItem(Item item){


        Item result = itemService.saveItem(item);
        return ResponseEntity.status(HttpStatus.CREATED).body(result);

    }
}
